We need to have “bank maps” to color in. Two sources:

  1. Dowloaded file [focus].
  2. Provided through an R-package [see other workshop].

Points of attention:

  • We want sf-objects. Frequently already right format, or convert using st_as_sf().
  • Reduce large map to what you need: filter, crop, or limit.
  • Pay attention to included identifier for merging.
library(dplyr)   # tidyverse datamanipulation library
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(sf)      # tidyverse spatial features library
## Linking to GEOS 3.5.1, GDAL 2.1.2, PROJ 4.9.3
library(janitor) # utility function clean_names()
## 
## Attaching package: 'janitor'
## The following objects are masked from 'package:stats':
## 
##     chisq.test, fisher.test
library(mapview)
library(tmap)
census1851_districts <- st_read(
  file.path(Sys.getenv('DATADIR_HIVA_LOCAL'), 'ukda_occuphist_1851/1851_england_wales_census_registration_districts/1851EngWalesRegistrationDistrict.shp')) %>%
  clean_names() # utility function from library janitor
## Reading layer `1851EngWalesRegistrationDistrict' from data source `/home/rstudio/var/data/datadir_hiva/ukda_occuphist_1851/1851_england_wales_census_registration_districts/1851EngWalesRegistrationDistrict.shp' using driver `ESRI Shapefile'
## Simple feature collection with 1194 features and 6 fields
## geometry type:  POLYGON
## dimension:      XY
## bbox:           xmin: 87019.07 ymin: 7067.26 xmax: 655747.5 ymax: 657473.5
## epsg (SRID):    NA
## proj4string:    +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +datum=OSGB36 +units=m +no_defs
mapview(census1851_districts)